from django.urls import path
from . import views

urlpatterns = [
    # 主要页面
    path('register/', views.register, name='register'),
    path('', views.dashboard, name='dashboard'),
    path('apply/', views.apply_leave, name='apply_leave'),
    path('my-leaves/', views.my_leaves, name='my_leaves'),
    path('all-leaves/', views.all_leaves, name='all_leaves'),
    path('approvals/', views.approval_list, name='approval_list'),
    path('profile/', views.profile, name='profile'),

    # 请假申请相关
    path('leave/<int:pk>/', views.leave_detail, name='leave_detail'),
    path('leave/<int:pk>/edit/', views.edit_leave, name='edit_leave'),
    path('leave/<int:pk>/approve/', views.approve_leave, name='approve_leave'),
    path('leave/<int:pk>/cancel/', views.cancel_leave, name='cancel_leave'),

    path('users/', views.user_management, name='user_management'),
    path('users/<int:user_id>/assign-role/', views.assign_role, name='assign_role'),

    # API接口
    path('api/leave-balance/', views.api_leave_balance, name='api_leave_balance'),
    path('api/calculate-days/', views.api_calculate_days, name='api_calculate_days'),
]
